package com.yun.zf.common.admin.dto.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class OrderSearchResMo {

    private String type;
    private String typeName;
    @ApiModelProperty(value = "订单id")
    private String oId;
    @ApiModelProperty(value = "合同编号")
    private String pactNo; // 合同编号
    @ApiModelProperty(value = "房源编号")
    private String houseId;
    @ApiModelProperty(value = "房源地址")
    private String address;
    // 成交价
    @ApiModelProperty(value = "成交价")
    private BigDecimal finalPrice;

    // 单位
    @ApiModelProperty(value = "成交价单位")
    private String priceUnit;
    @ApiModelProperty(value = "客户编号")
    private String customerId;
    @ApiModelProperty(value = "业主名称")
    private String ownName;
    @ApiModelProperty(value = "客户名称")
    private String cusName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "订单时间")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "经纪人名称")
    private String signName;
    @ApiModelProperty(value = "订单金额")
    private BigDecimal amount; // 订单金额

    public String getTypeName() {
        String s="";
        switch (type){
            case "1":
                s=  "租房";
                break;
            case "2":
                s=  "二手房";
                break;
        }
        return s;
    }
}
